import Vue from 'vue'
import Routers from 'vue-router'
import Main from '@/components/Main'
import Register from '@/components/Register'
import Login from '@/components/Login'
import Home from '@/components/Home'
import User from '@/components/User'
import ListData from '@/components/ListData'

Vue.use(Routers)

export default new Routers({
  routes: [
    {
      path: '/register',
      name: 'register',
      component: Register
    },
    {
      path: '/login',
      name: 'login',
      component: Login
    },
    {

      path: '/',
      name: 'main',
      component: Main,
      children: [
        {
          path:'/home',
          name:'home',
          component: Home
        },
        {
          path:'/user',
          name:'user',
          component: User
        },
        {
          path:'/listdata',
          name:'listdata',
          component: ListData
        }
      ]
    },
    {
      path:'/',
      redirect: '/main'
    }
  ]
})
